Many commonly used data storage devices, such as Solid State Drives (SSDs), are based on flash memory which is a type of Non-Volatile Random Access Memory (NVRAM) capable of storing data even if the power to the device is switched off. A memory cell within a flash memory is typically a floating gate field-effect transistor that holds a charge to indicate stored data. In Single-Level Cell (SLC) flash, the charge indicates one of two possible states (“1” or “0”) such that a single memory cell stores one bit of data. By contrast, Multi-Level Cell (MLC) flash uses additional charge states (e.g., “00”, “01”, “10”, or “11”) to enable a single memory cell to store two or more bits of data. The storage capacity in MLC flash may therefore be twice (or more) than in SLC flash using the same number of transistors, although there may be other tradeoff considerations such as latency, data retention, and the lifespan of the memory cells. etc.
Because flash stores data within the memory cells using a charge, changes to the charge over time can alter the data represented by the charge in the memory cells. This type of problem is more prevalent in MLC flash, since bit values in a MLC are assigned based on ranges of voltages in the memory cells. The ranges of voltages assigned to a particular bit value become smaller as a MLC stores more bits per memory cell, which can make discriminating the different states more difficult. Also, various activities during operation can disturb the charge stored by the memory cells, including write disturb, read disturb, inherent charge leakage in the cells, repeated write/erase cycles, etc.
One process that is performed to ensure that stored data is not lost is a refresh. During a refresh, data is read from the flash and is re-programmed in another location. A refresh process is typically performed based on the age of the data stored by the memory cells. However, a refresh process utilizes internal resources of the SSD that are therefore not available to service Input/Output (I/O) requests from the host. In addition, a refresh process introduces additional wear on the flash due to write amplification. Therefore, refreshing the data stored in the memory cells utilizing the age of the data may be more conservative than other factors that influence the retention of data in the memory cells.